import { _decorator, Component, Label, Node, random } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Dot')
export class Dot extends Component {
    @property(Label)
    dot: Label = null!;

    setDot(num: number) {
        this.dot.string = num.toString();
        if(this.dot.node.parent){
            this.dot.node.parent.active = num > 0;
        }
    }

    setRandom() {
        this.setDot((random() * 10 | 0));
    }


    onClick() {
    }
}


